<template>
  <div style="margin-top: 30px;">
    <el-row :gutter="20">
      <el-col :span="8">
        <el-link
          v-if="form.access_token==null"
          type="primary"
          :href="`/auth/code-get`"
        >绑定1688账户</el-link>
        <el-card v-else class="box-card">
          <div slot="header" class="clearfix">
            <span>1688 账户</span>
            <el-button style="float: right; padding: 3px 0" type="text">操作</el-button>
          </div>
          <div>
            <span class="show-list">用户名称：root</span>
            <br />
            <span class="show-list">access_token：{{form.access_token}}</span>
            <el-popconfirm title="确认要显示吗" @onConfirm="confirm">
              <el-button slot="reference" style="float: right; padding: 3px 0;" type="text">查看</el-button>
            </el-popconfirm>
            <br />
            <span class="show-list">绑定时间：{{form.date}}</span>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {},
    };
  },
  methods: {
    confirm() {
      this.form.access_token = "123456";
    },
    async getData(userId = 1) {
      await this.$http
        .get(`/userAli/user/info?username=admin`)
        .then((response) => {
          //this.form = response.data;
          console.log(response);
        })
        .catch((err) => {
          this.$message({ message: "网络错误", type: "warning" });
        });
    },
  },
  created() {
    this.getData();
  },
};
</script>

<style scoped>
.show-list {
  margin: 20px 20px 0 0;
}
</style>
